//
//  UILabel+SLSDK.m
//  SLTool
//
//  Created by SongLian on 16/7/10.
//  Copyright © 2016年 SongLian. All rights reserved.
//

#import "UILabel+SLSDK.h"
#import "SLConst.h"
#import "UIView+SLSDK.h"

@implementation UILabel (SLSDK)

+ (UILabel *)sl_labelWithOrigin:(CGPoint)origin
                          title:(NSString *)title {
    
    return [UILabel sl_labelWithOrigin:origin title:title titleSize:14.0 titleColor:SLColor_Black titleAlignment:NSTextAlignmentLeft];
}

+ (UILabel *)sl_labelWithOrigin:(CGPoint)origin
                          title:(NSString *)title
                      titleSize:(CGFloat)titleSize
                     titleColor:(UIColor *)titleColor {
    return [UILabel sl_labelWithOrigin:origin title:title titleSize:titleSize titleColor:titleColor titleAlignment:NSTextAlignmentLeft];
}

+ (UILabel *)sl_labelWithOrigin:(CGPoint)origin
                          title:(NSString *)title
                      titleSize:(CGFloat)titleSize
                     titleColor:(UIColor *)titleColor
                 titleAlignment:(NSTextAlignment)titleAlignment {
    UILabel *label = [UILabel sl_labelWithFrame:CGRectZero title:title titleSize:titleSize titleColor:titleColor titleAlignment:titleAlignment];
    [label sizeToFit];
    label.sl_origin = origin;
    return label;
}

+ (UILabel *)sl_labelWithFrame:(CGRect)frame
                         title:(NSString *)title
                     titleSize:(CGFloat)titleSize
                    titleColor:(UIColor *)titleColor
                titleAlignment:(NSTextAlignment)titleAlignment {
    UILabel *label = [[UILabel alloc] initWithFrame:frame];
    label.text = title;
    label.font = [UIFont systemFontOfSize:titleSize];
    label.textColor = titleColor;
    label.textAlignment = titleAlignment;
    label.backgroundColor = SLColor_Clear;
    return label;
}

@end
